
#include <QtCore/QString>
#include <QtCore/QStringList>

#include "types.h"
#include "moduleinfo.h"


class TranslatorInterface {
public:
    virtual ~TranslatorInterface() {}

    enum TranslatorError {
        //! Network Connection roblem
        NetworkError = 0x0001,

        //! Reply Parsing error
        BadReply = 0x0002,

        //! There's no reply from server or local program
        NoReply = 0x0003,

        //! Wrong language pair for translator.
        WrongPair = 0x0004,

        //! Wrong input text for translator
        WrongText = 0x0005,


        UnknowError = 0x0006,
        NoError = 0x0007
    };

    /*!
     * List of supported translate directions.
     * If this is empty, you can use any
     * direction from codes.
     *
     */
    LanguageDirectionList *getDirections() const = 0;

    //! Translate. Return true if successfully, or false if not.
    bool translate(const QString &src_lang,
                   const QString &dest_lang,
                   const QString &text) = 0;

    //! Return language codes (for this Translator)
    QStringList getCodes() const = 0;

    //! Return language names (for this Translator)
    QStringList getNames() const = 0;

    //! Return codes for icons (visual interface)
    QStringList getIconCodes() const = 0;

    //! Return translation error string
    QString errorString() const = 0;

    TranslatorError error() const = 0;

    /*!
     *  True if this translator use remove service,
     *  and false if translator use local program.
     */
    bool isRemoteTranslator() const = 0;


    /*!
     * True if translator using fixed directions.
     * In this case, you must use getDirections
     * for fill language comboboxes.
     *
     * And false if any direction from @keyword
     * getCodes can be used and no fixed directions.
     */
    bool isFixedDirections() const = 0;


    //! Return  pointer to ModuleInfo obj with information.
    ModuleInfo *getModuleInfo() const = 0;
};


